package com.stu.controller.student;

import com.stu.Dto.ClassJobApplicationDTO;
import com.stu.Dto.ComplaintDTO;
import com.stu.result.Result;
import com.stu.serive.ClassInformationService;
import com.stu.serive.ComplaintService;
import com.stu.vo.ComplaintVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Slf4j
@RestController
@RequestMapping("/student")
public class ComplaintController {

    @Autowired
    private ComplaintService complaintService;

    /**
     * 添加投诉信息
     * @param complaintDTO
     * @return
     */
    @PostMapping("/complaint")
    private Result insertComplaint(@RequestBody ComplaintDTO complaintDTO){
        complaintService.insertComplaint(complaintDTO);
        return Result.success();
    }

    /**
     * 查询投诉结果
     * @return
     */
    @GetMapping("/complaint")
    private Result<List<ComplaintVo>> selectComplaint(){
        return Result.success(complaintService.selectComplaint());
    }

}
